{% assign urlArray = page.url | replace: '/', ' ' | split: " " %}

{% assign activePlatform = urlArray[0] %}
{% assign platform = site.data.routes.platforms | where: "href", activePlatform | first %}

{% assign activeHub = urlArray[2] %}
{% assign hub = platform.hubs | where: "href", activeHub | first %}

{% assign activeSection = urlArray[3] | remove: ".html" %}
{% assign section = hub.sections | where: "href", activeSection | first %}

<h1 class="title">
    {{ section.title }}
</h1>

<section>
    <div class="cards-group">
        {% assign sortedArticles = section.articles | sort: 'order', 'last' | default: 999 %}
        {% for article in sortedArticles %}
            {% assign article_href = section.href | append: '/' | append: article.href %}
            {% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
        {% endfor %}
    </div>
</section>
